
<!DOCTYPE html>
<html lang="ch">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Y</title>
</head>
<body>
    <script>
        //alert("hello");
        console.log("hello");
        let a = 10 + "asd";
        console.log(a);
        let b = 10;
        let c = "10";
        console.log(b == c);
        console.log(b === c);

        //数组
        let arr = [1, 2, 3, true, "asd"];
        // console.log(arr);
        // arr[0] = "22";
        // console.log(arr);
        // console.log("arr[100]"+arr[100]);
        // arr[100] = "YZH";
        // console.log(arr);
        // arr[-1] = "HY";
        // console.log(arr)
        // arr["hello"] = "你好"
        // console.log(arr)

        // //遍历
        // for(let i = 0; i < arr.length; i++){
        //     console.log(arr[i]);
        // }
        // for(let i in arr){
        //     console.log(arr[i]);
        // }
        // for(let elem of arr){
        //     //此处elem是数组元素
        //     console.log(elem)
        // }

        //增
        arr.push(999);
        console.log(arr);
        const months = ['Jan', 'March', 'April', 'June'];
        months.splice(1, 2, 'AAA','asd');
        // Inserts at index 1
        console.log(months);
        //改 把第一个参数位置下的值替换为第三个参数,如果第二个参数为0就是在第一个参数后面增
        arr.splice()
    </script>
</body>
</html>